
'''
过滤函数
'''


def f1(x):
    return x % 2 == 0

li = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
# 过滤函数：filter()
filtered = filter(f1, li)
print(list(filtered))


def f2(x):
    return x * 2

mapped = map(f2, li)
print(list(mapped))